/**
 *	Monopolymorphism - A Java-based monopoly!
 *
 *	The final project of 
 *	Object-Oriented Programming Design of NTUCSIE
 *
 *	Authors:
 *		ChungKingSing.
 *		Qing-Cheng Li.
 *
 *	Card.java
 */
package monopolymorphism;

import java.lang.Math;

public abstract class Card{
	protected int num;
	protected char type;
	public abstract int getCard();
	public abstract void action(int cardId,Player x);
}

class ChanceCard extends Card{
	public ChanceCard(){
		num = 9;
		type = 'C';
	}
	public int getCard(){
		return (int)(Math.random()*(num-1));
	}
	public void action(int cardId,Player x){
		switch(cardId){
			case 0:
				
				System.out.println("This is ChanceCard case "+cardId+", on player "+x.getName());
				break;
			case 1:
				System.out.println("This is ChanceCard case "+cardId+", on player "+x.getName());
				break;
			case 2:
				System.out.println("This is ChanceCard case "+cardId+", on player "+x.getName());
				break;
			case 3:
				System.out.println("This is ChanceCard case "+cardId+", on player "+x.getName());
				break;
			case 4:
				System.out.println("This is ChanceCard case "+cardId+", on player "+x.getName());
				break;
			case 5:
				System.out.println("This is ChanceCard case "+cardId+", on player "+x.getName());
				break;
			case 6:
				System.out.println("This is ChanceCard case "+cardId+", on player "+x.getName());
				break;
			case 7:
				System.out.println("This is ChanceCard case "+cardId+", on player "+x.getName());
				break;
			case 8:
				System.out.println("This is ChanceCard case "+cardId+", on player "+x.getName());
				break;
			default:
				break;
		}
	}
}

class DestinyCard extends Card{
	public DestinyCard(){
		num = 9;
		type = 'D';
	}
	public int getCard(){
		return (int)(Math.random()*(num-1));
	}
	public void action(int cardId,Player x){
		switch(cardId){
			case 0:
				System.out.println("This is DestinyCard case "+cardId+", on player "+x.getName());
				break;
			case 1:
				System.out.println("This is DestinyCard case "+cardId+", on player "+x.getName());
				break;
			case 2:
				System.out.println("This is DestinyCard case "+cardId+", on player "+x.getName());
				break;
			case 3:
				System.out.println("This is DestinyCard case "+cardId+", on player "+x.getName());
				break;
			case 4:
				System.out.println("This is DestinyCard case "+cardId+", on player "+x.getName());
				break;
			case 5:
				System.out.println("This is DestinyCard case "+cardId+", on player "+x.getName());
				break;
			case 6:
				System.out.println("This is DestinyCard case "+cardId+", on player "+x.getName());
				break;
			case 7:
				System.out.println("This is DestinyCard case "+cardId+", on player "+x.getName());
				break;
			case 8:
				System.out.println("This is DestinyCard case "+cardId+", on player "+x.getName());
				break;
			default:
				break;
		}
	}
}
